package com.obas.integration.element.service.impl;

import java.util.Date;

import com.ease.common.util.DateFormatUtil;
import com.ease.common.util.DateUtil;
import com.obas.integration.common.service.impl.AbstractIntegrationFileServiceImpl;
import com.obas.integration.element.service.ElementIntegrationFileService;

public class ElementIntegrationFileServiceImpl extends AbstractIntegrationFileServiceImpl implements ElementIntegrationFileService {

	public void doLoad(String fileNamePrefix, Date batchTimestamp, final String controlTemplateName) {

		String fileName = fileNamePrefix + DateFormatUtil.toDatatimeNumberString(batchTimestamp) + ".DAT";

		this.load(fileName, batchTimestamp, controlTemplateName);
	}

	public void loadDeviceMacAddress() {

		String fileNamePrefix = "DATA_MAC_TABLE_ALL_";
		String controlTemplateName = "huawei.mac_table_all.ctl.ftl";

		Date date = new Date();
		Date batchTimestamp = DateUtil.getLastQuarterDate(date);

		this.doLoad(fileNamePrefix, batchTimestamp, controlTemplateName);

	}

}
